import request from '@/utils/request'

// 查询流程实例列表
export function listInstance(query) {
  return request({
    url: '/flow/instance/list',
    method: 'get',
    params: query
  })
}

// 办理
export function handle(id, conditionValue, message) {
  return request({
    url: '/flow/instance/handle?id=' + id + '&conditionValue=' + conditionValue + '&message=' + message,
    method: 'get'
  })
}

// 查询流程实例详细
export function getInstance(id) {
  return request({
    url: '/flow/instance/' + id,
    method: 'get'
  })
}

// 新增流程实例
export function addInstance(data) {
  return request({
    url: '/flow/instance',
    method: 'post',
    data: data
  })
}

// 修改流程实例
export function updateInstance(data) {
  return request({
    url: '/flow/instance',
    method: 'put',
    data: data
  })
}

// 删除流程实例
export function delInstance(id) {
  return request({
    url: '/flow/instance/' + id,
    method: 'delete'
  })
}
